package com.study.mike.model.dto;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.study.mike.common.annotation.EncryptField;
import com.study.mike.common.converter.BookStatusConverter;
import com.study.mike.common.enums.BookStatusEnum;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author KangHui
 * @since 2022-07-08
 */
@Data
public class BookDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @ExcelIgnore
    private Integer id;

    /**
     * 书名
     */
    @ExcelProperty("书名")
    private String bookName;

    /**
     * 编号
     */
    @EncryptField
    @ExcelProperty("编号")
    private String bookNo;

    /**
     * 价格
     */
    @ExcelProperty("价格")
    private BigDecimal bookPrice;

    /**
     * 作者
     */
    @EncryptField
    @ExcelProperty("作者")
    private String bookAuthor;


    /**
     * 状态0禁用、1启用
     */
    @ExcelProperty(value = "状态", converter = BookStatusConverter.class)
    private BookStatusEnum status;

    /**
     * 出版日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ExcelProperty("出版日期")
    private Date bookTime;

    /**
     * 创建日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ExcelIgnore
    private Date createTime;

    /**
     * 更新日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ExcelIgnore
    private Date updateTime;

    /**
     * 是否删除0存在，1删除
     */
    @ExcelIgnore
    private Long deleteFlag;

}
